package cn.weiyuanbiao.DbGeneralCore.util;

public class FieldToClassUtil {
	public static String getClassField(String fieldType) {

		String type = "";
		switch (fieldType.toLowerCase()) {
		case "varchar":
		case "tinytext":
		case "text":
		case "mediumtext":
		case "char":
		case "longtext":
			type = "String";
			break;
		case "bit":
			type = "boolean";
			break;
		case "int":
		case "mediumint":
			type = "int";
			break;
		case "smallint":
			type = "short";
			break;
		case "tinyint":
			type = "byte";
			break;
		case "bigint":
			type = "long";
			break;
		case "datetime":
			type = "Date";
			break;
		case "decimal":
			type = "BigDecimal";
			break;
		default:
			System.err.println("还没有解析：" + fieldType + "     默认给了string");
			type = "String";
			break;
		}
		return type;
	}
}
